/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

/**
 *
 * @author Endlesslove
 */
public class KhachHang  implements  Idata
{
    private String MaKhachHang;
    public String TenhachHang;
    public String DiaChi;
    public String Email;
    public String DienThoai;
    public int TienNo;
    public int TienNo2; //Dung cho viec ti kiem
    public KhachHang(String ...param)
    {
        MaKhachHang = param[0];
        TenhachHang = param[1];
        DiaChi = param[2];
        Email = param[3];
        DienThoai = param[4];
        TienNo = Integer.parseInt(param[5]);
        try
        {
            TienNo2 = Integer.parseInt(param[6]);
        }
        catch(Exception ex)
        {
            TienNo2 = TienNo;
        }
    }
    
    @Override
    public boolean Delete() 
    {
        return new BUS.KhachHang().Delete(this);
    }

    @Override
    public boolean Insert() 
    {
        return new BUS.KhachHang().Insert(this);
    }

    @Override
    public boolean Update() 
    {
        return new BUS.KhachHang().Update(this);
    }

    @Override
    public Object[] getObjects() 
    {
        return new Object[]
        {
            MaKhachHang,TenhachHang,DiaChi,Email,DienThoai,  TienNo
        };
    }
    @Override
    public String getID() 
    {
        return MaKhachHang;
    }
    
}
